
package net.flowas.genericcrud;

import java.io.Serializable;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import javax.transaction.Transactional;

import net.flowas.genericcrud.dto.PageModdel;
import net.flowas.genericcrud.dto.QueryOption;

/**
 * 数据存储处理.
 * @author Administrator
 */
public interface RepositoryService {  

  Long count(QueryOption<Map<String, Object>> option, Class type);
  <T> List<T> findRang(QueryOption<Map<String, Object>> option, Class<T> type);
  <T> PageModdel<T> queryWithCount(QueryOption<Map<String, Object>> option, Class<T> type);
  @Transactional
  Object saveOrUpdate(Object entity);

  @Transactional
  void remove(Class type,Object id);
  
  <T> T findById(Class<T> type, Object t);
  
  void detach(Object entity);

  Collection<Class<? extends Serializable>> getHandledTypes();
}
